package homework_2;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.*;

public class Test {
    public static void main(String args[]){
        File file = new File("E:\\javaooGit\\javaooDay22\\src\\practice\\a.txt");
        String s = "";

        try (FileReader fr = new FileReader(file);
             BufferedReader in = new BufferedReader(fr)){
            String a = "";
            while((a = in.readLine()) != null){
                s += a;
            }
        }catch (Exception e){
            e.printStackTrace();
        }

        Set set = new HashSet();
        char[] chs = s.toCharArray();

        for (int i = 0; i < chs.length; i++) {
            set.add(chs[i]);
        }

        List list = new ArrayList();
        list.addAll(set);
        Collections.sort(list);
        System.out.println(list);
        String s2 = "abcfds";
        System.out.println(s2.substring(0,2));


    }
}
